package cn.highedu.demo;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Component;

/**
 * 工人
 */
@Component
public class Worker {
    private String name = "光头强";

    @Autowired
    @Qualifier("axe")
    private Tool tool;

    public void work() {
        System.out.println(name + "在工作, 使用" + tool + "砍树");
    }
}
